<?php
/*
 * Copyright 2009, Jeffrey Palm.
 */

/*
 * The phone will call this page a new shared_key, if it doesn't have
 * one stored.  This shared key is given by all devices and that's
 * their identity.
 *
 * INPUT: user
 * OUTPUT: shared_key
 */

include 'top.php';

$user = param('user');

$shared_key = getSharedKeyForUser($user);
if (!$shared_key) {
	$shared_key = createAndInsertNewSharedKey($user);
}
echo $shared_key;

include 'done.php';

?>